package edu.usx.server.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonProperty;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author Usx
 * @since 2024-07-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "Sites对象", description = "")
public class Sites implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "服务id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "服务名称")
    private String name;

    @ApiModelProperty(value = "服务对应的分类id")
    @TableField("category_id")
    private Integer categoryId;

    @ApiModelProperty(value = "服务详情描述")
    private String description;

    @ApiModelProperty(value = "服务的图标连接")
    private String icon;

    @ApiModelProperty(value = "服务的状态 (1 已上架 2 已经下架 0 审核中)")
    private Integer status;

    @ApiModelProperty(value = "服务的访问连接")
    private String link;

    @ApiModelProperty(value = "服务创建人")
    @TableField("create_user")
    private Integer createUser;

    @ApiModelProperty(value = "服务修改人")
    @TableField("update_user")
    private Integer updateUser;

    @ApiModelProperty(value = "服务创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "服务修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
    @TableField("update_time")
    private LocalDateTime updateTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    @JsonProperty(value = "category_id")//必须加入这个注解,否则@Requestbody捕获不到
    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public Integer getCreateUser() {
        return createUser;
    }

    public void setCreateUser(Integer createUser) {
        this.createUser = createUser;
    }

    public Integer getUpdateUser() {
        return updateUser;
    }

}
